import pyb

# led = pyb.LED(4)
# led.off()

# INTENSITY = 0
#while(1):
	# while(INTENSITY < 255):
		# INTENSITY += 5
		# led.intensity(INTENSITY)
		# pyb.delay(100)

	# while(INTENSITY > 0):
		# INTENSITY -= 5
		# led.intensity(INTENSITY)
		# pyb.delay(100)

def RunLightShow():
	leds = [pyb.LED(i) for i in range(1,5)]
	for l in leds: 
	    l.off()

	n = 0
	try:
		seconds = 10
	   while seconds-=1:
	      n = (n + 1) % 4
	      leds[n].toggle()
	      pyb.delay(50)
	finally:
	    for l in leds:
	        l.off()

lscb = pyb.Switch().callback(RunLightShow)

#lscb = LeftSwitch.callback(some_function_to_be_defined)


